import request from '@/utils/request'
// 获取文章列表
export function getartlist (data) {
  return request({
    url: `/my/article/list?pagenum=${data.pagenum}&pagesize=${data.pagesize}&cate_id=${data.cate_id}&state=${data.state}`,
    method: 'get'
  })
}
//  添加文章请求
export function postartlist (data) {
  return request({
    url: '/my/article/add',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
// 获取文章详情
export function getartlistinfo (id) {
  return request({
    url: `/my/article/info?id=${id}`,
    method: 'get'
  })
}
// 更新文章
export function putartlistinfo (data) {
  return request({
    url: '/my/article/info',
    method: 'put',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
// 删除文章
export function delartlistinfo (id) {
  return request({
    url: `/my/article/info?id=${id}`,
    method: 'DELETE'
  })
}
